<% /* $Id: source.jsp 132 2011-08-26 10:23:42Z altdotua@gmail.com $ */ %>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%@ include file="header.jsp" %>

<%
	if (user == null)
	{
		response.sendRedirect(Linker.link("login.jsp?return=" + URLEncoder.encode(request.getRequestURI())));
		return;
	}
	SubmissionFull submissionFull = SubmissionsModel.getSubmissionFull(Long.parseLong(request.getParameter("submission_id")));
	if (null == submissionFull)
	{
%>
		<h2 align="center">Розвязок не знайдено</h2>
<%
	}
	else
	{
		if (null == user || (!(user.isAdmin() || submissionFull.getSubmissionEntry().getUserId().equals(user.getId()))))
		{
%>
			<h2 align="center">Доступ заборонено</h2>
<%
		}
		else
		{
%>
<h2><a href="<%= Linker.link("submission.jsp?submission_id=" + submissionFull.getSubmissionEntry().getId()) %>">Результат перевірки</a></h2>
		<%= StringEscapeUtils.escapeHtml(submissionFull.getSubmissionDetailsEntry().getSourceCode()) %>
<%
		}
	}
%>

</body>

